package cn.codeforfun.service

import cn.codeforfun.dao.UserDao
import cn.codeforfun.entity.User
import org.springframework.stereotype.Service
import javax.annotation.Resource

@Service
open class UserService {
    @Resource
    private var userDao: UserDao? = null

    fun findAll(): List<User> = userDao?.findAll() as List<User>

    fun findById(id: String): User = userDao?.findOne(id) as User

    fun save(user: User) = userDao?.save(user)
}